<?php
namespace app\home\controller;
use think\Controller;
use think\Validate;
class Userm extends Base
{
	//用户中心
	public function user()
	{
		return $this->fetch();
	}
	//修改密码
	public function uppwd()
	{

		if($this->request->isPost())
		{
			//dump(input());
			
			$result=model('member')->checkold(input('post.oldpassword'));
			if($result===true)
			{
				model('Member')->updpwd(['password'=>input('post.password')]);
				return $this->success('修改成功');
			}
			else
			{
				return $this->error($result['msg']);
			}
		}
		else
		{
			return $this->fetch();
		}
	}
	//退出登录
    public function outLogin()
    {
        session('qid',null);
        return $this->success('退出成功','home/Home/index');
    }
}